<template>
    <component :is="pageType" v-on="$listeners" v-bind="$attrs" :option="option" />
</template>

<script>
import textCom from './text'
import chartDiagram from './chartDiagram'
export default {
    name: 'GenescloudUiIndex',
    components: {
        textCom, chartDiagram
    },
    props: {
        option: {
            type: Object,
            default: () => { }
        }
    },
    data() {
        return {
            pageType: null,
        };
    },
    created() {
        this.init()
    },

    methods: {
        init() {
            let config = {
                1: 'textCom',
                2: 'chartDiagram',
                3: 'chartDiagram',
                4: 'chartDiagram',
            }
            this.pageType = config[this.option.type] || 'chartDiagram'
        }
    },
};
</script>

<style lang="scss" scoped></style>